package com.ash.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 消耗信息
 * @TableName account_cost_info
 */
@TableName(value ="account_cost_info")
@Data
public class AccountCostInfo implements Serializable {
    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 户号ID
     */
    @TableField(value = "channel_id")
    private String channelId;

    /**
     * 账号外键
     */
    @TableField(value = "account_id")
    private Long accountId;

    /**
     * 服务商外键
     */
    @TableField(value = "platform_id")
    private Long platformId;

    /**
     * 投放信息外键
     */
    @TableField(value = "setup_id")
    private Long setupId;

    /**
     * 账号金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 户号总消耗
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 账号关注数
     */
    @TableField(value = "follow_num")
    private Integer followNum;

    /**
     * 户号关注数
     */
    @TableField(value = "total_follow_num")
    private Integer totalFollowNum;

    /**
     * 展示数
     */
    @TableField(value = "view_count")
    private Integer viewCount;

    /**
     * 点击数
     */
    @TableField(value = "click_count")
    private Integer clickCount;

    /**
     * 频次类型（Runtime 0 ; Daily 1）
     */
    @TableField(value = "data_frequency")
    private Integer dataFrequency;

    /**
     * 投放日期
     */
    @TableField(value = "cost_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date costDate;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtModified;

    /**
     * 逻辑删除
     */
    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AccountCostInfo other = (AccountCostInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getChannelId() == null ? other.getChannelId() == null : this.getChannelId().equals(other.getChannelId()))
            && (this.getAccountId() == null ? other.getAccountId() == null : this.getAccountId().equals(other.getAccountId()))
            && (this.getPlatformId() == null ? other.getPlatformId() == null : this.getPlatformId().equals(other.getPlatformId()))
            && (this.getSetupId() == null ? other.getSetupId() == null : this.getSetupId().equals(other.getSetupId()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()))
            && (this.getFollowNum() == null ? other.getFollowNum() == null : this.getFollowNum().equals(other.getFollowNum()))
            && (this.getTotalFollowNum() == null ? other.getTotalFollowNum() == null : this.getTotalFollowNum().equals(other.getTotalFollowNum()))
            && (this.getViewCount() == null ? other.getViewCount() == null : this.getViewCount().equals(other.getViewCount()))
            && (this.getClickCount() == null ? other.getClickCount() == null : this.getClickCount().equals(other.getClickCount()))
            && (this.getDataFrequency() == null ? other.getDataFrequency() == null : this.getDataFrequency().equals(other.getDataFrequency()))
            && (this.getCostDate() == null ? other.getCostDate() == null : this.getCostDate().equals(other.getCostDate()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getChannelId() == null) ? 0 : getChannelId().hashCode());
        result = prime * result + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
        result = prime * result + ((getPlatformId() == null) ? 0 : getPlatformId().hashCode());
        result = prime * result + ((getSetupId() == null) ? 0 : getSetupId().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
        result = prime * result + ((getFollowNum() == null) ? 0 : getFollowNum().hashCode());
        result = prime * result + ((getTotalFollowNum() == null) ? 0 : getTotalFollowNum().hashCode());
        result = prime * result + ((getViewCount() == null) ? 0 : getViewCount().hashCode());
        result = prime * result + ((getClickCount() == null) ? 0 : getClickCount().hashCode());
        result = prime * result + ((getDataFrequency() == null) ? 0 : getDataFrequency().hashCode());
        result = prime * result + ((getCostDate() == null) ? 0 : getCostDate().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", channelId=").append(channelId);
        sb.append(", accountId=").append(accountId);
        sb.append(", platformId=").append(platformId);
        sb.append(", setupId=").append(setupId);
        sb.append(", amount=").append(amount);
        sb.append(", totalAmount=").append(totalAmount);
        sb.append(", followNum=").append(followNum);
        sb.append(", totalFollowNum=").append(totalFollowNum);
        sb.append(", viewCount=").append(viewCount);
        sb.append(", clickCount=").append(clickCount);
        sb.append(", dataFrequency=").append(dataFrequency);
        sb.append(", costDate=").append(costDate);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
